program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  arr = array of integer;

var
  mass: array of arr;
  f, r, n, k, i, j, sum, a, b: integer;

begin
  sum:= 0;
  read (f, r, n, k);
  setlength (mass, f);
  for I := 0 to f-1 do
    setlength (mass[i], r);
  for i := 0 to f-1 do
    for j := 0 to r - 1 do
      mass[i, j]:= 0;
  for i := 0 to n - 1 do
  begin
    read (a, b);
    inc (mass[a-1, b-1]);
    if mass[a-1, b-1]>k then
      inc (sum);
  end;
  write (sum);
end.
